package lab03.test03;

import java.io.*;

public class Test03 {
    public static void main(String[] args) {
        try {
            FileOutputStream fileOutputStream = new FileOutputStream("D:\\dev\\sctu-java-2017-1\\1606101016杨金鸿\\src\\lab03\\test03");
            DataOutputStream dataOutputStream =new DataOutputStream(fileOutputStream);
            dataOutputStream.writeChars("beijing欢迎你!");
            dataOutputStream.close();
        } catch (java.io.IOException e) {
            e.printStackTrace();
        }
        try {
            FileInputStream fileInputStream =new FileInputStream("D:\\dev\\sctu-java-2017-1\\1606101016杨金鸿\\src\\lab03\\test03");
            DataInputStream dataInputStream =new DataInputStream(fileInputStream);
            System.out.print(dataInputStream.readChar());
            System.out.print(dataInputStream.readChar());
            System.out.print(dataInputStream.readChar());
            System.out.print(dataInputStream.readChar());
            System.out.print(dataInputStream.readChar());
            System.out.print(dataInputStream.readChar());
            System.out.print(dataInputStream.readChar());
            System.out.print(dataInputStream.readChar());
            System.out.print(dataInputStream.readChar());
            System.out.print(dataInputStream.readChar());
            System.out.print(dataInputStream.readChar());
            dataInputStream.close();
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
